Databases often utilize page caches to improve performance. The page cache stores frequently-accessed pages from the database and is generally faster to access than the underlying database. Generally, when a query is made, the page cache is first checked to see if the desired data is in one of the pages in the cache (called a “cache hit”). If so, the data is retrieved from the cache. Only if the data is not in the cache (called a “cache miss”) is the underlying database accessed for the data.
With the growth in popularity of mobile devices, more and more databases have been created to operate on mobile devices. Often these mobile device databases support synchronization with a server. When these mobile device databases were first implemented, however, mobile devices had much stricter memory requirements than they do now. Available memory has increased greatly on modern smartphones, and mobile device databases have generally adapted by using a large page cache.
In order to access a row of data in a mobile device database, the mobile device database usually looks up the row location in a map (stored in the database file) and loads the page containing the row. It then unpacks (de-serializes) the row into memory for access. The unpacked row is typically larger than the packed row because of variably-sized columns which are fixed (and aligned) when unpacked. This operation is on the usual path for many database requests. Unpacking the rows each time, however, adds extra computation time.